<template>
	<div></div>
</template>
<script setup name="check-token">
import { onMounted } from 'vue';
import { checkToken } from '@/api/login/login';

const refreshLock = ref(false);
const refreshTime = ref();


onMounted(()=>{
	console.log("测试chetoken组件mounted挂在")
	refreshToken();
})

/**
 * 定期检查token是否过期
 */
const refreshToken = () => {
	refreshTime.value = setInterval(() => {
		checkToken(refreshTime.value, refreshLock.value);
	}, 60000);
};
</script>
